<?php
class My_Acl extends Zend_Acl
{
  public function __construct()
   {
      // Add Role
      $this->addRole(new Zend_Acl_Role('admin'));
           
      // Add Resource
      // Các Controller trong Module Default
      $this->addResource(new Zend_Acl_Resource('default:index'));
      
      
      // Các Controller trong Module User
      $this->addResource(new Zend_Acl_Resource('user:auth'));
      $this->addResource(new Zend_Acl_Resource('user:index'));
      //developer
      $this->addResource(new Zend_Acl_Resource('developer:index'));
      $this->addResource(new Zend_Acl_Resource('developer:app'));
      $this->addResource(new Zend_Acl_Resource('developer:user'));
      
      //admin
      $this->addResource(new Zend_Acl_Resource('admin:index'));
      $this->addResource(new Zend_Acl_Resource('admin:home'));
      $this->addResource(new Zend_Acl_Resource('admin:app'));
      $this->addResource(new Zend_Acl_Resource('admin:developer'));
      //error
      $this->addResource(new Zend_Acl_Resource('error:error'));
      
      
      
      // Phân quyền
      //Guests
      
      
      //$this->allow(null,'default:index',null);// Vào tất cả các action của C-Index trong M-Default
     
      $this->allow(null,'error:error',null);
      //$this->allow(null,'admin:home','index');// Vào tất cả các action của C-Index trong M-Default
      
      $this->allow('admin',null,null); // Vào được tất cả
      
      
   }
}
